package Day14;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ChangePwdPanel extends JPanel implements ActionListener {
    private ATM05 atm05;
    private JLabel pwdChangeLabel = new JLabel("密码：");
    private JLabel pwdChange1Label = new JLabel("确认密码：");
    private JPasswordField passwordField = new JPasswordField();
    private JPasswordField passwordField1 = new JPasswordField();
    private Font font = new Font("宋体", Font.BOLD, 20);
    private JButton sureBtn = new JButton(new ImageIcon("Image/buttonSure.jpg"));
    public ChangePwdPanel(ATM05 atm05){
        this.atm05 = atm05;
        this.setLayout(null);
        this.setOpaque(false);

        pwdChangeLabel.setBounds(300, 200, 80, 50);
        pwdChangeLabel.setFont(font);
        this.add(pwdChangeLabel);

        pwdChange1Label.setBounds(300, 250, 80, 50);
        pwdChange1Label.setFont(font);
        this.add(pwdChange1Label);

        passwordField.setBounds(380, 200, 250, 50);
        passwordField.setFont(font);
        this.add(passwordField);

        passwordField1.setBounds(380, 250, 250, 50);
        passwordField1.setFont(font);
        this.add(passwordField1);

        sureBtn.setBounds(430, 320, 140, 50);
        sureBtn.addActionListener(this);
        this.add(sureBtn);


    }
    @Override
    public void actionPerformed(ActionEvent e) {
        atm05.showPanel("menu");
    }
}
